--wifi
require "wifi"
dofile("wifi.lua")
--dofile("uart.lua")
MY_SSID = "DORLINK_1"
MY_PASSWORD = "dorlink1931"
--MY_SSID = "T440"
--MY_PASSWORD = "88888888"


led = 3 
gpio.mode(led, gpio.OUTPUT) 
gpio.write(led, gpio.LOW) 

--wifi连接，并设定自动重连时间
wifiConnect(MY_SSID, MY_PASSWORD, 1000)
--wifi.sta.eventMonStart(1000)

--成功连接并获取IP后执行mqtt
wifi.sta.eventMonReg(wifi.STA_GOTIP, function()
    blinking()
    print("Config done, IP is "..wifi.sta.getip())
	dofile("MQTT.lua") 
    dofile("mcunode.lua") 
end)
